home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
lib
/
include
/
sys
/
RCS
/
wait.h,v
< prev
Wrap
Text File
|
1991-10-25
|
6KB
|
252 lines
head 1.8;
branch ;
access ;
symbols ;
locks ; strict;
comment @ * @;
1.8
date 91.10.25.01.28.44; author rab; state Exp;
branches ;
next 1.7;
1.7
date 91.07.25.12.12.59; author mendel; state Exp;
branches ;
next 1.6;
1.6
date 90.05.02.17.13.50; author rab; state Exp;
branches ;
next 1.5;
1.5
date 89.08.14.14.40.43; author rab; state Exp;
branches ;
next 1.4;
1.4
date 89.07.14.09.15.43; author rab; state Exp;
branches ;
next 1.3;
1.3
date 88.06.29.14.48.33; author ouster; state Exp;
branches ;
next 1.2;
1.2
date 88.06.21.17.36.50; author ouster; state Exp;
branches ;
next 1.1;
1.1
date 88.06.21.16.12.58; author ouster; state Exp;
branches ;
next ;
desc
@@
1.8
log
@Added casts for (union wait) in all macros.
@
text
@/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @@(#)wait.h 7.4 (Berkeley) 1/27/88
*/
#ifndef _WAIT
#define _WAIT
/*
* This file holds definitions relevent to the wait system call.
* Some of the options here are available only through the ``wait3''
* entry point; the old entry point with one argument has more fixed
* semantics, never returning status of unstopped children, hanging until
* a process terminates if any are outstanding, and never returns
* detailed information about process resource utilization (<vtimes.h>).
*/
#include <machine/machparam.h>
/*
* Structure of the information in the first word returned by both
* wait and wait3. If w_stopval==WSTOPPED, then the second structure
* describes the information returned, else the first. See WUNTRACED below.
*/
union wait {
int w_status; /* used in syscall */
/*
* Terminated process status.
*/
struct {
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned int w_Termsig:7; /* termination signal */
unsigned int w_Coredump:1; /* core dump indicator */
unsigned int w_Retcode:8; /* exit code if w_termsig==0 */
#endif
#if BYTE_ORDER == BIG_ENDIAN
unsigned short w_Filler; /* upper bits filler */
unsigned char w_Retcode; /* exit code if w_termsig==0 */
unsigned int w_Coredump:1; /* core dump indicator */
unsigned int w_Termsig:7; /* termination signal */
#endif
} w_T;
/*
* Stopped process status. Returned
* only for traced children unless requested
* with the WUNTRACED option bit.
*/
struct {
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned int w_Stopval:8; /* == W_STOPPED if stopped */
unsigned int w_Stopsig:8; /* signal that stopped us */
#else
unsigned short w_Filler; /* upper bits filler */
unsigned char w_Stopsig; /* signal that stopped us */
unsigned char w_Stopval; /* == W_STOPPED if stopped */
#endif
} w_S;
};
#define w_termsig w_T.w_Termsig
#define w_coredump w_T.w_Coredump
#define w_retcode w_T.w_Retcode
#define w_stopval w_S.w_Stopval
#define w_stopsig w_S.w_Stopsig
#define WSTOPPED 0177 /* value of s.stopval if process is stopped */
/*
* Option bits for the second argument of wait3. WNOHANG causes the
* wait to not hang if there are no stopped or terminated processes, rather
* returning an error indication in this case (pid==0). WUNTRACED
* indicates that the caller should receive status about untraced children
* which stop due to signals. If children are stopped and a wait without
* this option is done, it is as though they were still running... nothing
* about them is returned.
*/
#define WNOHANG 1 /* dont hang in wait */
#define WUNTRACED 2 /* tell about stopped, untraced children */
#define WIFSTOPPED(x) (((union wait *) &(x))->w_stopval == WSTOPPED)
#define WIFSIGNALED(x) (((union wait *) &(x))->w_stopval != WSTOPPED && \
((union wait *) &(x))->w_termsig != 0)
#define WIFEXITED(x) (((union wait *) &(x))->w_stopval != WSTOPPED && \
((union wait *) &(x))->w_termsig == 0)
#define WEXITSTATUS(x) (((union wait *) &(x))->w_retcode)
#define WTERMSIG(x) (((union wait *) &(x))->w_termsig)
#define WSTOPSIG(x) (((union wait *) &(x))->w_stopsig)
extern int wait();
extern int wait3();
#endif /* _WAIT */
@
1.7
log
@Modified to include machparam.h as <machine/machparam.h>
@
text
@d83 8
a90 3
#define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED)
#define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0)
#define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0)
@
1.6
log
@Added declarations for wait() and wait3().
@
text
@d21 1
a21 1
#include <machparam.h>
@
1.5
log
@Fixed declaration of bitfields.
@
text
@d87 3
@
1.4
log
@*** empty log message ***
@
text
@d35 3
a37 3
unsigned short w_Termsig:7; /* termination signal */
unsigned short w_Coredump:1; /* core dump indicator */
unsigned short w_Retcode:8; /* exit code if w_termsig==0 */
d42 2
a43 2
unsigned char w_Coredump:1; /* core dump indicator */
unsigned char w_Termsig:7; /* termination signal */
d53 2
a54 2
unsigned short w_Stopval:8; /* == W_STOPPED if stopped */
unsigned short w_Stopsig:8; /* signal that stopped us */
@
1.3
log
@Add ifdefs to prevent files from being included multiple times.
@
text
@d34 1
a34 1
#if BYTE_ORDER == LITTLE_ENDIAN
d39 1
a39 1
#if BYTE_ORDER == BIG_ENDIAN
d52 1
a52 1
#if BYTE_ORDER == LITTLE_ENDIAN
d87 1
a87 1
#endif _WAIT
@
1.2
log
@Pick up machine-dependent stuff from correct place.
@
text
@d9 3
d86 2
@
1.1
log
@Initial revision
@
text
@d18 1
a18 3
#ifndef BYTE_ORDER
#include <machine/endian.h>
#endif
@